Public Class Admin

    Private Sub Admin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'Rabbitsettings.Settings' table. You can move, or remove it, as needed.
        Me.SettingsTableAdapter.Fill(Me.Rabbitsettings.Settings)

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Me.SettingsTableAdapter.Update(Me.Rabbitsettings.Settings)
        Me.Rabbitsettings.AcceptChanges()
        MsgBox("Now restart the application for this to take effect!")
    End Sub

   

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.Close()
    End Sub

    Private Sub FolderBrowserDialog1_HelpRequest(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FolderBrowserDialog1.HelpRequest

    End Sub

    Private Sub backup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles backup.Click
        FolderBrowserDialog1.ShowDialog()
        FolderBrowserDialog1.Description = "Browse To Backup Loacation"
        TextBox1.Text = FolderBrowserDialog1.SelectedPath
        'MsgBox("Are you Sure you want to backup the database ?", MsgBoxStyle.YesNoCancel, "Warning")
        Dim fileExists As Boolean
        fileExists = My.Computer.FileSystem.FileExists(TextBox1.Text & "\Rabbit.mdb")
        If fileExists = True Then
            MsgBox("File already exists ! Overwrite ?", MsgBoxStyle.YesNo)
            If DialogResult.OK Then
                My.Computer.FileSystem.DeleteFile(TextBox1.Text & "\Rabbit.mdb", FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.DeletePermanently)
                My.Computer.FileSystem.CopyFile("Rabbit.mdb", TextBox1.Text & "\Rabbit.mdb")
                MsgBox("Backup Completed to " & TextBox1.Text & "\Rabbit.mdb", MsgBoxStyle.Information)
            End If
        End If
        If fileExists = False Then
            My.Computer.FileSystem.CopyFile("Rabbit.mdb", TextBox1.Text & "\Rabbit.mdb")
            MsgBox("Backup Completed to " & TextBox1.Text & "\Rabbit.mdb", MsgBoxStyle.Information)
        End If

    End Sub

    Private Sub Label4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label4.Click

    End Sub
End Class